package com._101aiot.web.exception;

import com._101aiot.common.resultutil.IResultCode;
import com._101aiot.web.asserts.Assert;

import java.text.MessageFormat;

/**
 * 业务异常断言接口
 *  每个业务模块使用枚举类并实现接口 BusinessExceptionAssert
 */
public interface BusinessExceptionAssert extends IResultCode, Assert {

    @Override
    default BaseException newException(Object... args) {
        // String msg = MessageFormat.format(this.getMessage(), args);
        return new BusinessException(this, args.length == 0? null : args);
    }

}